package com.karry.yl.dao.elder;

import com.karry.commons.base.SuperMapper;
import com.karry.yl.domain.elder.Elderly;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


public interface ElderlyMapper extends SuperMapper<Elderly> {

    @Update("update elderly set openId=#{openId} where id = #{elderlyId}")
    void setOpenId(@Param("openId") String openId, @Param("elderlyId") Long elderlyId);

    @Update("update elderly set openId=null where openId = #{openId}")
    void clearBind(@Param("openId") String openId);

    @Select("select id from elderly where openId=#{openId}")
    Long checkOpenId(String openId);
}
